<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <meta name="renderer" content="webkit"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>

  <!--[if lt IE 7]>
  <meta http-equiv="refresh" content="0; url=/YouLose.htm"/><![endif]-->

  <link rel="stylesheet" href="/reception/css/normalize.css" type="text/css"/>
  <link rel="stylesheet" href="/reception/css/secondary.css" type="text/css"/>
  <!--[if lt IE 9]>
  <script language="javascript" type="text/javascript" src="/reception/js/Kunyi.Respond.min.js"></script><![endif]-->
  <script language="javascript" type="text/javascript" src="/reception/js/KunyiHTML5.min.js"></script>
  <script language="javascript" type="text/javascript" src="/reception/js/Kunyilibrary.js"></script>
</head>
<body>
<script language="javascript" type="text/javascript" src="/reception/js/Kunyi.Init.js"></script>
<div th:insert="~{common::header}"></div>
<div th:insert="~{common::nav}"></div>

<section class="BaseMark">
  <div class="bread">您所在的位置<span><a href="/index">首页</a> > 个人信息</span>
  </div>
  <h2>个人信息</h2>
  <div class="emailMain">
    <div class="tabBase">
      <a href="/reception/profile" class="active">个人信息</a>
      <a href="/reception/my/book" >我的预定</a>
    </div>
    <div class="clear"></div>
    <div class="emaillist">
      <form id="MessageForm" onsubmit="return false">

        <input type="hidden" id="id" name="id" th:value="${session.current_user.id}">
        <span>电子邮箱</span>
        <input name="email" type="email" th:value="${session.current_user.email}" disabled="disabled" maxlength="50" id="email" autocomplete="off"><br>

        <span>用户名</span>
        <input name="name" type="text" th:value="${session.current_user.name}"  id="name" autocomplete="off"><br>

        <span>手机号</span>
        <input name="phone" type="text" th:value="${session.current_user.phone}"  id="phone" autocomplete="off"><br>

        <span>密码</span>
        <input name="password" type="password" placeholder="不输入密码则不会进行更新"  id="password" autocomplete="off"><br>
        <input type="button" onclick="updateUserInfo()" value="修改个人信息" class="search animated"><br>
      </form>

      <div class="clear"></div>

    </div>
  </div>
  <div class="clear"></div>
  </div>
  <div class="clear"></div>
</section>
<div class="BottomHidden"></div>
<div th:insert="~{common :: #footer}"></div>

<script language="javascript" type="text/javascript" src="/reception/js/Kunyi.Common.js"></script>
<script language="javascript" type="text/javascript" src="/reception/js/Kunyi.Secondary.js"></script>

<script>
  function updateUserInfo() {
    $.ajax({
      url: '/reception/user/update',
      dataType: 'JSON',
      type: 'POST',
      data: {
        email:$("#email").val(),
        id:$("#id").val(),
        name:$("#name").val(),
        phone:$("#phone").val(),
        password:$("#password").val()
      },
      success: function (result) {
          alert(result.msg);
      }
    })

  }
</script>
</body>
</html>
